package com.config;

import com.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by Administrator on 2018/11/9 0009.
 */
@Component
public class ScheduledTasks {
    @Autowired
    private LoginService loginService;

    //每一天执行一次
//    @Scheduled(cron = "0 0 12 * * ?")
//    public void reportCurrentByCron() {
//        int success = loginService.findTimedTask();
//        System.out.println("定时清理过期formId");
//    }

    //每五秒
    @Scheduled(cron = "0/5 * * * * ?")
    public void deleteMoney() {
        int count = loginService.findUserYou50();
        if(count > 0){
            System.out.println("正常删除");
        }else{
            System.out.println("异常");
        }
        System.out.println("五秒来一次");
    }
}
